<template>
  <div>
    <div class="search">
      <van-icon name="location-o" size="0.6rem" color="#fff" />
      <i class="i">小u商城</i>
      <to-search width="50%"></to-search>

    </div>

   <!-- 展示数据  -->
   <list-vue :goods="goods"></list-vue>
  </div>
</template>

<script>
import { reqCateList } from "../../http/api";
export default {
  data() {
    return {
      goods: [],
    };
  },
  mounted() {
    //  在一进入的时候就要发送请求
    reqCateList({
      cateid: this.$route.query.id,
      type: this.$route.query.type,
    }).then((res) => {
      console.log(res);
      this.goods = res.data.list.goodData ? res.data.list.goodData : [];
    });
  },
};
</script>

<style scoped lang="less">
@import "../../less/index.less";
a {
  display: block;
  margin: @margin20;
  padding: @padding20;
  display: inline-block;
}
.search{
  background: @deep;
}
.i{
  font-size: 0.3rem;
  line-height: 0.6rem;
  color: #fff;
  margin-right: 1rem;
}
</style>